import http from '../utils/request'

export const swiper = () => {
  return http({
    method: 'get',
    url: '/api/getlunbo'
  })
}

export const grids = () => {
  return http({
    method: 'get',
    url: '/api/grids'
  })
}

export const news = () => {
  return http({
    method: 'get',
    url: '/api/getnewslist'
  })
}

export const getdetail = (id) => {
  return http({
    method: 'get',
    url: '/api/getnew/' + id
  })
}
export const getcomment = ({ id, pageindex, limit }) => {
  return http({
    method: 'get',
    url: `/api/getcomments/${id}?pageindex=${pageindex}&limit=${limit}`
  })
}

export const sendcomment = ({ id, content }) => {
  return http({
    method: 'post',
    url: '/api/postcomment/' + id,
    data: {
      content
    }
  })
}

export const getphotoList = () => {
  return http({
    method: 'get',
    url: '/api/getimgcategory'
  })
}

export const getImg = (id) => {
  return http({
    method: 'get',
    url: '/api/getimages/' + id
  })
}
export const getgoods = ({ pageindex, limit }) => {
  return http({
    method: 'get',
    url: `/api/getgoods?pageindex=${pageindex}&limit=${limit}`
  })
}
export const getgoodsMsg = (id) => {
  return http({
    method: 'get',
    url: `/api/goods/getinfo/` + id
  })
}

export const getImageInfo = id => {
  return http({
    method: 'get',
    url: '/api/getimageInfo/' + id
  })
}

export const getThumimages = id => {
  return http({
    method: 'get',
    url: '/api/getthumimages/' + id
  })
}

///api/goods/getinfo/:id